#pragma once
#include "../../Render/RenderAPI.hpp"
#include "../../Render/GraphicsContext.hpp"
#include "../../Core/Base.hpp"
#include "../../Core/Window.hpp"
#include <GLFW/glfw3.h>
namespace Kriko
{
	class WindowsWindow : public Window
	{
	public:
		WindowsWindow(const WindowProc& p_props);
		virtual ~WindowsWindow();

		void VOnUpdate() override;

		const size_t VGetWidth() const override { return m_WindowData.m_width; }
		const size_t VGetHeight() const override { return m_WindowData.m_height; }

		void SetEventCallBack(const EventListenerDelegate& p_callBackFunc) override { m_WindowData.m_EventCallBack = p_callBackFunc; }
		void VSetVSync(bool p_enabled) override;
		bool VIsVsync() const override { return m_WindowData.m_VSync; }

		void* VGetNativeWindow() const override { return m_Window;}
	private:
		void Init(const WindowProc& p_props);
		void ShutDown();
	private:
		struct WindowData
		{
			std::string m_Title;
			size_t m_width, m_height;
			bool m_VSync;
			EventListenerDelegate m_EventCallBack;
		};
		WindowData m_WindowData;
		GLFWwindow* m_Window;
		Scope<GraphicsContext> m_Context;
	};
}